<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    管理员管理
    <!--<small>Optional description</small>-->
  </h1>
  <ol class="breadcrumb">
    <li><a href="#">首页</a></li>
    <li>用户管理</li>
    <li>管理员管理</li>
    <li>添加管理员</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box">
        <div class="box-header with-border">
          <h3 class="box-title">添加管理员</h3>
        </div>
        <!-- /.box-header -->
        <!-- form start -->
        <%= form_for @user, url: admin_users_path, html: {class: 'form-horizontal'} do |f| %>
            <div class="box-body">
              <div class="form-group">
                <%= f.label :name, '用户名', class: 'col-sm-2 control-label' %>
                <div class="col-xs-5">
                  <%= f.text_field :name, class: 'form-control' %>
                </div>
                <% if @user.errors[:name].any? %>
                    <span style="color: #dd4b39;"><%= @user.errors[:name][0] %></span>
                <% end %>
              </div>
              <div class="form-group">
                <%= f.label :password, sanitize('密&nbsp;&nbsp;&nbsp;&nbsp;码'), class: 'col-sm-2 control-label' %>
                <div class="col-xs-5">
                  <%= f.password_field :password, class: 'form-control' %>
                </div>
                <% if @user.errors[:password].any? %>
                    <span style="color: #dd4b39;"><%= @user.errors[:password][0] %></span>
                <% end %>
              </div>
              <div class="form-group">
                <%= f.label :password_confirmation, '密码确认', class: 'col-sm-2 control-label' %>
                <div class="col-xs-5">
                  <%= f.password_field :password_confirmation, class: 'form-control' %>
                </div>
                <% if @user.errors[:password_confirmation].any? %>
                    <span style="color: #dd4b39;"><%= @user.errors[:password_confirmation][0] %></span>
                <% end %>
              </div>
              <div class="form-group">
                <%= f.label :note, sanitize('备&nbsp;&nbsp;&nbsp;&nbsp;忘'), class: 'col-sm-2 control-label' %>
                <div class="col-xs-5">
                  <%= f.text_area :note, class: 'form-control', rows: 5 %>
                </div>
              </div>
            </div>

            <div class="box-footer">
              <button type="submit" class="btn btn-primary">确认</button>
            </div>
        <% end %>
      </div>
    </div>
  </div>
</section><!-- /.content -->